﻿
IF object_id(N'dbo.[UDS_Role]', 'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[UDS_Role] (
        [Role_ID]          int          NOT NULL identity(1, 1),
        [Role_Name]        nvarchar(255) COLLATE Chinese_PRC_CI_AS NOT NULL,
        [Role_Description] nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,

        CONSTRAINT [PK_UDS_Role] PRIMARY KEY CLUSTERED ([Role_ID] asc)
    );
END
GO

SET NOCOUNT ON;
IF NOT EXISTS (SELECT 1 FROM dbo.UDS_Role)
BEGIN
    SET IDENTITY_INSERT dbo.UDS_Role ON;
    INSERT INTO dbo.UDS_Role(Role_ID, Role_Name, Role_Description) VALUES(1, N'Admin', N'Admin');
    INSERT INTO dbo.UDS_Role(Role_ID, Role_Name, Role_Description) VALUES(12, N'系统默认角色', N'对于系统默认的权力，全部以此角色来实现，加入到此角色的人拥有系统的默认权力');
    INSERT INTO dbo.UDS_Role(Role_ID, Role_Name, Role_Description) VALUES(31, N'总经理', N'总经理');
    INSERT INTO dbo.UDS_Role(Role_ID, Role_Name, Role_Description) VALUES(42, N'销售人员', N'所有销售人员');
    SET IDENTITY_INSERT dbo.UDS_Role OFF;
END